package com.party.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.party.business.domain.TNews;
import com.party.business.mapper.TNewsMapper;
import com.party.business.service.ITNewsService;
import com.party.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 赛事新闻Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-13
 */
@Service
public class TNewsServiceImpl extends ServiceImpl<TNewsMapper, TNews>  implements ITNewsService
{
    @Autowired
    private TNewsMapper tNewsMapper;

    /**
     * 查询赛事新闻
     *
     * @param id 赛事新闻主键
     * @return 赛事新闻
     */
    @Override
    public TNews selectTNewsById(String id)
    {
        return tNewsMapper.selectTNewsById(id);
    }

    /**
     * 查询赛事新闻列表
     *
     * @param tNews 赛事新闻
     * @return 赛事新闻
     */
    @Override
    public List<TNews> selectTNewsList(TNews tNews)
    {
        return tNewsMapper.selectTNewsList(tNews);
    }

    /**
     * 新增赛事新闻
     *
     * @param tNews 赛事新闻
     * @return 结果
     */
    @Override
    public int insertTNews(TNews tNews)
    {
                tNews.setCreateTime(DateUtils.getNowDate());
            return tNewsMapper.insertTNews(tNews);
    }

    /**
     * 修改赛事新闻
     *
     * @param tNews 赛事新闻
     * @return 结果
     */
    @Override
    public int updateTNews(TNews tNews)
    {
                tNews.setUpdateTime(DateUtils.getNowDate());
        return tNewsMapper.updateTNews(tNews);
    }

    /**
     * 批量删除赛事新闻
     *
     * @param ids 需要删除的赛事新闻主键
     * @return 结果
     */
    @Override
    public int deleteTNewsByIds(String[] ids)
    {
        return tNewsMapper.deleteTNewsByIds(ids);
    }

    /**
     * 删除赛事新闻信息
     *
     * @param id 赛事新闻主键
     * @return 结果
     */
    @Override
    public int deleteTNewsById(String id)
    {
        return tNewsMapper.deleteTNewsById(id);
    }
}
